import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const store = new Vuex.Store({
    state: {
		user : uni.getStorageSync("user"),
		material : {},
		uploadList : []
	},
    mutations: {
		// 登录
		toLogin(state, user) {
		  state.user = user;
		  uni.setStorageSync("user",user);
		},
		setMaterial(state, material) {
		  state.material = material;
		},
		setUploadList(state, uploadList) {
		  state.uploadList = uploadList;
		}
	},
	getters : {
	    isLogin(state){
			return Boolean(state.user);
		}
	},
    actions: {
		
	}
})
export default store